/**
 * 
 */
package com.ideeli.webextractor.exe;

import org.junit.Test;
import org.springframework.context.ApplicationContext;

import com.ideeli.webextractor.context.WebExatractorContext;
import com.ideeli.webextractor.dao.ProductDao;
import com.ideeli.webextractor.service.PriceChangeService;

/**
 * @author spaida
 *
 */
public class ApplyFieldValueChanges {
//
//	/**
//	 * @param args
//	 */
//	public static void main(String[] args) {
//		
//		ApplicationContext context =WebExatractorContext.getApplicationContext();
//		PriceChangeService priceChangeService=context.getBean("pricechangeservice",PriceChangeService.class);
//		priceChangeService.chgPerCategory("S:\\webextractor\\data\\input1.csv");
//		
//
//	}
//	
	@Test
	public void testApplyPerCategory() throws Exception
	{
		ApplicationContext context =WebExatractorContext.getApplicationContext();
		PriceChangeService priceChangeService=context.getBean("pricechangeservice",PriceChangeService.class);
		priceChangeService.chgPerCategory("S:\\webextractor\\data\\input1.csv");
		
	}
	
	@Test
	public void testApplyFixedToAll() throws Exception
	{
		ApplicationContext context =WebExatractorContext.getApplicationContext();
		PriceChangeService priceChangeService=context.getBean("pricechangeservice",PriceChangeService.class);
		priceChangeService.flatPercentageChgToAll(10.0f);
	}
	
	@Test
	public void testApplyTrimNameChgToAll() throws Exception
	{
		ApplicationContext context =WebExatractorContext.getApplicationContext();
		ProductDao productDao=context.getBean("productdao",ProductDao.class);
		
		productDao.trimNameChangeAll();
		
	}
	
	@Test
	public void rePrice() throws Exception
	{
		ApplicationContext context =WebExatractorContext.getApplicationContext();
		PriceChangeService priceChangeService=context.getBean("pricechangeservice",PriceChangeService.class);
		priceChangeService.rePrice();
		
	}


}
